<?php if ($this->requestAction('sites/site_list/' . $this->data['Customer']['id']) != null) : ?>

<?php echo $html->link('View as Customer',
    array('controller' => 'its_admins', 'action' => 'view_as_customer_user', $this->data['Customer']['id']),
    array('id' => 'viewAsCustomer', 'class' => 'button viewAsCustomer', 'title' => 'View as Customer head office user'),
    null, false);
?>
<?php echo $this->element('javascript/confirm_link', array(
        'id' => 'viewAsCustomer', 'message' => "Do you want to view as \"{$this->data['Customer']['name']}\" head office user?"));?>
<?php endif; ?>